<?php
namespace app\api\controller\v1;
use app\admin\controller\Reason;
use app\service\MoneyLogService;
use app\service\OrderService;
use think\Db;
use app\service\UserWeixinService;
use app\service\TechnWeixinService;
use app\service\PosterService;
use app\service\TechnService;

use app\service\PaymentService;
use think\Request;


class Welcome extends Base
{
	public function _initialize()
	{
		parent::_initialize();
	}

    public function everyday_info(){
        $min = strtotime('2023-03-01 00:00:00');
        $max = strtotime('2023-03-01 23:59:59');
        $info = [];
        for ($i = 0; $i<1000; $i++){

            $sum_day = Db::name('order')
                ->where('status','in',[1,2,3,4,5,6])
                ->where('pay_time','>=',$min)
                ->where('pay_time','<',$max)
                ->sum('pay_price');
            if (!empty($sum_day)){
                $info[] = [strtotime(date('Y-m-d',$min).' 08:00:00')*1000,$sum_day];
            }else{
                return json_encode($info);
            }
        }
    }
    
}